<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - /usr/include/google/protobuf/message_lite.h</title>
  <link rel="stylesheet" type="text/css" href="../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../index.html">top level</a> - <a href="index.html">usr/include/google/protobuf</a> - message_lite.h<span style="font-size: 80%;"> (source / <a href="message_lite.h.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntryHi">100.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:25:26</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntryHi">-</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : // Protocol Buffers - Google's data interchange format</a>
<span class="lineNum">       2 </span>            : // Copyright 2008 Google Inc.  All rights reserved.
<span class="lineNum">       3 </span>            : // https://developers.google.com/protocol-buffers/
<span class="lineNum">       4 </span>            : //
<span class="lineNum">       5 </span>            : // Redistribution and use in source and binary forms, with or without
<span class="lineNum">       6 </span>            : // modification, are permitted provided that the following conditions are
<span class="lineNum">       7 </span>            : // met:
<span class="lineNum">       8 </span>            : //
<span class="lineNum">       9 </span>            : //     * Redistributions of source code must retain the above copyright
<span class="lineNum">      10 </span>            : // notice, this list of conditions and the following disclaimer.
<span class="lineNum">      11 </span>            : //     * Redistributions in binary form must reproduce the above
<span class="lineNum">      12 </span>            : // copyright notice, this list of conditions and the following disclaimer
<span class="lineNum">      13 </span>            : // in the documentation and/or other materials provided with the
<span class="lineNum">      14 </span>            : // distribution.
<span class="lineNum">      15 </span>            : //     * Neither the name of Google Inc. nor the names of its
<span class="lineNum">      16 </span>            : // contributors may be used to endorse or promote products derived from
<span class="lineNum">      17 </span>            : // this software without specific prior written permission.
<span class="lineNum">      18 </span>            : //
<span class="lineNum">      19 </span>            : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
<span class="lineNum">      20 </span>            : // &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
<span class="lineNum">      21 </span>            : // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
<span class="lineNum">      22 </span>            : // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
<span class="lineNum">      23 </span>            : // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
<span class="lineNum">      24 </span>            : // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
<span class="lineNum">      25 </span>            : // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
<span class="lineNum">      26 </span>            : // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
<span class="lineNum">      27 </span>            : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
<span class="lineNum">      28 </span>            : // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<span class="lineNum">      29 </span>            : // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<span class="lineNum">      30 </span>            : 
<span class="lineNum">      31 </span>            : // Authors: wink@google.com (Wink Saville),
<span class="lineNum">      32 </span>            : //          kenton@google.com (Kenton Varda)
<span class="lineNum">      33 </span>            : //  Based on original Protocol Buffers design by
<span class="lineNum">      34 </span>            : //  Sanjay Ghemawat, Jeff Dean, and others.
<span class="lineNum">      35 </span>            : //
<span class="lineNum">      36 </span>            : // Defines MessageLite, the abstract interface implemented by all (lite
<span class="lineNum">      37 </span>            : // and non-lite) protocol message objects.
<span class="lineNum">      38 </span>            : 
<span class="lineNum">      39 </span>            : #ifndef GOOGLE_PROTOBUF_MESSAGE_LITE_H__
<span class="lineNum">      40 </span>            : #define GOOGLE_PROTOBUF_MESSAGE_LITE_H__
<span class="lineNum">      41 </span>            : 
<span class="lineNum">      42 </span>            : #include &lt;google/protobuf/stubs/common.h&gt;
<span class="lineNum">      43 </span>            : 
<span class="lineNum">      44 </span>            : namespace google {
<span class="lineNum">      45 </span>            : namespace protobuf {
<span class="lineNum">      46 </span>            : 
<span class="lineNum">      47 </span>            : namespace io {
<span class="lineNum">      48 </span>            :   class CodedInputStream;
<span class="lineNum">      49 </span>            :   class CodedOutputStream;
<span class="lineNum">      50 </span>            :   class ZeroCopyInputStream;
<span class="lineNum">      51 </span>            :   class ZeroCopyOutputStream;
<span class="lineNum">      52 </span>            : }
<span class="lineNum">      53 </span>            : 
<span class="lineNum">      54 </span>            : // Interface to light weight protocol messages.
<span class="lineNum">      55 </span>            : //
<span class="lineNum">      56 </span>            : // This interface is implemented by all protocol message objects.  Non-lite
<span class="lineNum">      57 </span>            : // messages additionally implement the Message interface, which is a
<span class="lineNum">      58 </span>            : // subclass of MessageLite.  Use MessageLite instead when you only need
<span class="lineNum">      59 </span>            : // the subset of features which it supports -- namely, nothing that uses
<span class="lineNum">      60 </span>            : // descriptors or reflection.  You can instruct the protocol compiler
<span class="lineNum">      61 </span>            : // to generate classes which implement only MessageLite, not the full
<span class="lineNum">      62 </span>            : // Message interface, by adding the following line to the .proto file:
<span class="lineNum">      63 </span>            : //
<span class="lineNum">      64 </span>            : //   option optimize_for = LITE_RUNTIME;
<span class="lineNum">      65 </span>            : //
<span class="lineNum">      66 </span>            : // This is particularly useful on resource-constrained systems where
<span class="lineNum">      67 </span>            : // the full protocol buffers runtime library is too big.
<span class="lineNum">      68 </span>            : //
<span class="lineNum">      69 </span>            : // Note that on non-constrained systems (e.g. servers) when you need
<span class="lineNum">      70 </span>            : // to link in lots of protocol definitions, a better way to reduce
<span class="lineNum">      71 </span>            : // total code footprint is to use optimize_for = CODE_SIZE.  This
<span class="lineNum">      72 </span>            : // will make the generated code smaller while still supporting all the
<span class="lineNum">      73 </span>            : // same features (at the expense of speed).  optimize_for = LITE_RUNTIME
<span class="lineNum">      74 </span>            : // is best when you only have a small number of message types linked
<span class="lineNum">      75 </span>            : // into your binary, in which case the size of the protocol buffers
<span class="lineNum">      76 </span>            : // runtime itself is the biggest problem.
<span class="lineNum">      77 </span>            : class LIBPROTOBUF_EXPORT MessageLite {
<span class="lineNum">      78 </span>            :  public:
<span class="lineNum">      79 </span><span class="lineCov">        517 :   inline MessageLite() {}</span>
<span class="lineNum">      80 </span>            :   virtual ~MessageLite();
<span class="lineNum">      81 </span>            : 
<span class="lineNum">      82 </span>            :   // Basic Operations ------------------------------------------------
<span class="lineNum">      83 </span>            : 
<span class="lineNum">      84 </span>            :   // Get the name of this message type, e.g. &quot;foo.bar.BazProto&quot;.
<span class="lineNum">      85 </span>            :   virtual string GetTypeName() const = 0;
<span class="lineNum">      86 </span>            : 
<span class="lineNum">      87 </span>            :   // Construct a new instance of the same type.  Ownership is passed to the
<span class="lineNum">      88 </span>            :   // caller.
<span class="lineNum">      89 </span>            :   virtual MessageLite* New() const = 0;
<span class="lineNum">      90 </span>            : 
<span class="lineNum">      91 </span>            :   // Clear all fields of the message and set them to their default values.
<span class="lineNum">      92 </span>            :   // Clear() avoids freeing memory, assuming that any memory allocated
<span class="lineNum">      93 </span>            :   // to hold parts of the message will be needed again to hold the next
<span class="lineNum">      94 </span>            :   // message.  If you actually want to free the memory used by a Message,
<span class="lineNum">      95 </span>            :   // you must delete it.
<span class="lineNum">      96 </span>            :   virtual void Clear() = 0;
<span class="lineNum">      97 </span>            : 
<span class="lineNum">      98 </span>            :   // Quickly check if all required fields have values set.
<span class="lineNum">      99 </span>            :   virtual bool IsInitialized() const = 0;
<span class="lineNum">     100 </span>            : 
<span class="lineNum">     101 </span>            :   // This is not implemented for Lite messages -- it just returns &quot;(cannot
<span class="lineNum">     102 </span>            :   // determine missing fields for lite message)&quot;.  However, it is implemented
<span class="lineNum">     103 </span>            :   // for full messages.  See message.h.
<span class="lineNum">     104 </span>            :   virtual string InitializationErrorString() const;
<span class="lineNum">     105 </span>            : 
<span class="lineNum">     106 </span>            :   // If |other| is the exact same class as this, calls MergeFrom().  Otherwise,
<span class="lineNum">     107 </span>            :   // results are undefined (probably crash).
<span class="lineNum">     108 </span>            :   virtual void CheckTypeAndMergeFrom(const MessageLite&amp; other) = 0;
<span class="lineNum">     109 </span>            : 
<span class="lineNum">     110 </span>            :   // Parsing ---------------------------------------------------------
<span class="lineNum">     111 </span>            :   // Methods for parsing in protocol buffer format.  Most of these are
<span class="lineNum">     112 </span>            :   // just simple wrappers around MergeFromCodedStream().  Clear() will be called
<span class="lineNum">     113 </span>            :   // before merging the input.
<span class="lineNum">     114 </span>            : 
<span class="lineNum">     115 </span>            :   // Fill the message with a protocol buffer parsed from the given input
<span class="lineNum">     116 </span>            :   // stream.  Returns false on a read error or if the input is in the
<span class="lineNum">     117 </span>            :   // wrong format.
<span class="lineNum">     118 </span>            :   bool ParseFromCodedStream(io::CodedInputStream* input);
<span class="lineNum">     119 </span>            :   // Like ParseFromCodedStream(), but accepts messages that are missing
<span class="lineNum">     120 </span>            :   // required fields.
<span class="lineNum">     121 </span>            :   bool ParsePartialFromCodedStream(io::CodedInputStream* input);
<span class="lineNum">     122 </span>            :   // Read a protocol buffer from the given zero-copy input stream.  If
<span class="lineNum">     123 </span>            :   // successful, the entire input will be consumed.
<span class="lineNum">     124 </span>            :   bool ParseFromZeroCopyStream(io::ZeroCopyInputStream* input);
<span class="lineNum">     125 </span>            :   // Like ParseFromZeroCopyStream(), but accepts messages that are missing
<span class="lineNum">     126 </span>            :   // required fields.
<span class="lineNum">     127 </span>            :   bool ParsePartialFromZeroCopyStream(io::ZeroCopyInputStream* input);
<span class="lineNum">     128 </span>            :   // Read a protocol buffer from the given zero-copy input stream, expecting
<span class="lineNum">     129 </span>            :   // the message to be exactly &quot;size&quot; bytes long.  If successful, exactly
<span class="lineNum">     130 </span>            :   // this many bytes will have been consumed from the input.
<span class="lineNum">     131 </span>            :   bool ParseFromBoundedZeroCopyStream(io::ZeroCopyInputStream* input, int size);
<span class="lineNum">     132 </span>            :   // Like ParseFromBoundedZeroCopyStream(), but accepts messages that are
<span class="lineNum">     133 </span>            :   // missing required fields.
<span class="lineNum">     134 </span>            :   bool ParsePartialFromBoundedZeroCopyStream(io::ZeroCopyInputStream* input,
<span class="lineNum">     135 </span>            :                                              int size);
<span class="lineNum">     136 </span>            :   // Parse a protocol buffer contained in a string.
<span class="lineNum">     137 </span>            :   bool ParseFromString(const string&amp; data);
<span class="lineNum">     138 </span>            :   // Like ParseFromString(), but accepts messages that are missing
<span class="lineNum">     139 </span>            :   // required fields.
<span class="lineNum">     140 </span>            :   bool ParsePartialFromString(const string&amp; data);
<span class="lineNum">     141 </span>            :   // Parse a protocol buffer contained in an array of bytes.
<span class="lineNum">     142 </span>            :   bool ParseFromArray(const void* data, int size);
<span class="lineNum">     143 </span>            :   // Like ParseFromArray(), but accepts messages that are missing
<span class="lineNum">     144 </span>            :   // required fields.
<span class="lineNum">     145 </span>            :   bool ParsePartialFromArray(const void* data, int size);
<span class="lineNum">     146 </span>            : 
<span class="lineNum">     147 </span>            : 
<span class="lineNum">     148 </span>            :   // Reads a protocol buffer from the stream and merges it into this
<span class="lineNum">     149 </span>            :   // Message.  Singular fields read from the input overwrite what is
<span class="lineNum">     150 </span>            :   // already in the Message and repeated fields are appended to those
<span class="lineNum">     151 </span>            :   // already present.
<span class="lineNum">     152 </span>            :   //
<span class="lineNum">     153 </span>            :   // It is the responsibility of the caller to call input-&gt;LastTagWas()
<span class="lineNum">     154 </span>            :   // (for groups) or input-&gt;ConsumedEntireMessage() (for non-groups) after
<span class="lineNum">     155 </span>            :   // this returns to verify that the message's end was delimited correctly.
<span class="lineNum">     156 </span>            :   //
<span class="lineNum">     157 </span>            :   // ParsefromCodedStream() is implemented as Clear() followed by
<span class="lineNum">     158 </span>            :   // MergeFromCodedStream().
<span class="lineNum">     159 </span>            :   bool MergeFromCodedStream(io::CodedInputStream* input);
<span class="lineNum">     160 </span>            : 
<span class="lineNum">     161 </span>            :   // Like MergeFromCodedStream(), but succeeds even if required fields are
<span class="lineNum">     162 </span>            :   // missing in the input.
<span class="lineNum">     163 </span>            :   //
<span class="lineNum">     164 </span>            :   // MergeFromCodedStream() is just implemented as MergePartialFromCodedStream()
<span class="lineNum">     165 </span>            :   // followed by IsInitialized().
<span class="lineNum">     166 </span>            :   virtual bool MergePartialFromCodedStream(io::CodedInputStream* input) = 0;
<span class="lineNum">     167 </span>            : 
<span class="lineNum">     168 </span>            : 
<span class="lineNum">     169 </span>            :   // Serialization ---------------------------------------------------
<span class="lineNum">     170 </span>            :   // Methods for serializing in protocol buffer format.  Most of these
<span class="lineNum">     171 </span>            :   // are just simple wrappers around ByteSize() and SerializeWithCachedSizes().
<span class="lineNum">     172 </span>            : 
<span class="lineNum">     173 </span>            :   // Write a protocol buffer of this message to the given output.  Returns
<span class="lineNum">     174 </span>            :   // false on a write error.  If the message is missing required fields,
<span class="lineNum">     175 </span>            :   // this may GOOGLE_CHECK-fail.
<span class="lineNum">     176 </span>            :   bool SerializeToCodedStream(io::CodedOutputStream* output) const;
<span class="lineNum">     177 </span>            :   // Like SerializeToCodedStream(), but allows missing required fields.
<span class="lineNum">     178 </span>            :   bool SerializePartialToCodedStream(io::CodedOutputStream* output) const;
<span class="lineNum">     179 </span>            :   // Write the message to the given zero-copy output stream.  All required
<span class="lineNum">     180 </span>            :   // fields must be set.
<span class="lineNum">     181 </span>            :   bool SerializeToZeroCopyStream(io::ZeroCopyOutputStream* output) const;
<span class="lineNum">     182 </span>            :   // Like SerializeToZeroCopyStream(), but allows missing required fields.
<span class="lineNum">     183 </span>            :   bool SerializePartialToZeroCopyStream(io::ZeroCopyOutputStream* output) const;
<span class="lineNum">     184 </span>            :   // Serialize the message and store it in the given string.  All required
<span class="lineNum">     185 </span>            :   // fields must be set.
<span class="lineNum">     186 </span>            :   bool SerializeToString(string* output) const;
<span class="lineNum">     187 </span>            :   // Like SerializeToString(), but allows missing required fields.
<span class="lineNum">     188 </span>            :   bool SerializePartialToString(string* output) const;
<span class="lineNum">     189 </span>            :   // Serialize the message and store it in the given byte array.  All required
<span class="lineNum">     190 </span>            :   // fields must be set.
<span class="lineNum">     191 </span>            :   bool SerializeToArray(void* data, int size) const;
<span class="lineNum">     192 </span>            :   // Like SerializeToArray(), but allows missing required fields.
<span class="lineNum">     193 </span>            :   bool SerializePartialToArray(void* data, int size) const;
<span class="lineNum">     194 </span>            : 
<span class="lineNum">     195 </span>            :   // Make a string encoding the message. Is equivalent to calling
<span class="lineNum">     196 </span>            :   // SerializeToString() on a string and using that.  Returns the empty
<span class="lineNum">     197 </span>            :   // string if SerializeToString() would have returned an error.
<span class="lineNum">     198 </span>            :   // Note: If you intend to generate many such strings, you may
<span class="lineNum">     199 </span>            :   // reduce heap fragmentation by instead re-using the same string
<span class="lineNum">     200 </span>            :   // object with calls to SerializeToString().
<span class="lineNum">     201 </span>            :   string SerializeAsString() const;
<span class="lineNum">     202 </span>            :   // Like SerializeAsString(), but allows missing required fields.
<span class="lineNum">     203 </span>            :   string SerializePartialAsString() const;
<span class="lineNum">     204 </span>            : 
<span class="lineNum">     205 </span>            :   // Like SerializeToString(), but appends to the data to the string's existing
<span class="lineNum">     206 </span>            :   // contents.  All required fields must be set.
<span class="lineNum">     207 </span>            :   bool AppendToString(string* output) const;
<span class="lineNum">     208 </span>            :   // Like AppendToString(), but allows missing required fields.
<span class="lineNum">     209 </span>            :   bool AppendPartialToString(string* output) const;
<span class="lineNum">     210 </span>            : 
<span class="lineNum">     211 </span>            :   // Computes the serialized size of the message.  This recursively calls
<span class="lineNum">     212 </span>            :   // ByteSize() on all embedded messages.  If a subclass does not override
<span class="lineNum">     213 </span>            :   // this, it MUST override SetCachedSize().
<span class="lineNum">     214 </span>            :   virtual int ByteSize() const = 0;
<span class="lineNum">     215 </span>            : 
<span class="lineNum">     216 </span>            :   // Serializes the message without recomputing the size.  The message must
<span class="lineNum">     217 </span>            :   // not have changed since the last call to ByteSize(); if it has, the results
<span class="lineNum">     218 </span>            :   // are undefined.
<span class="lineNum">     219 </span>            :   virtual void SerializeWithCachedSizes(
<span class="lineNum">     220 </span>            :       io::CodedOutputStream* output) const = 0;
<span class="lineNum">     221 </span>            : 
<span class="lineNum">     222 </span>            :   // Like SerializeWithCachedSizes, but writes directly to *target, returning
<span class="lineNum">     223 </span>            :   // a pointer to the byte immediately after the last byte written.  &quot;target&quot;
<span class="lineNum">     224 </span>            :   // must point at a byte array of at least ByteSize() bytes.
<span class="lineNum">     225 </span>            :   virtual uint8* SerializeWithCachedSizesToArray(uint8* target) const;
<span class="lineNum">     226 </span>            : 
<span class="lineNum">     227 </span>            :   // Returns the result of the last call to ByteSize().  An embedded message's
<span class="lineNum">     228 </span>            :   // size is needed both to serialize it (because embedded messages are
<span class="lineNum">     229 </span>            :   // length-delimited) and to compute the outer message's size.  Caching
<span class="lineNum">     230 </span>            :   // the size avoids computing it multiple times.
<span class="lineNum">     231 </span>            :   //
<span class="lineNum">     232 </span>            :   // ByteSize() does not automatically use the cached size when available
<span class="lineNum">     233 </span>            :   // because this would require invalidating it every time the message was
<span class="lineNum">     234 </span>            :   // modified, which would be too hard and expensive.  (E.g. if a deeply-nested
<span class="lineNum">     235 </span>            :   // sub-message is changed, all of its parents' cached sizes would need to be
<span class="lineNum">     236 </span>            :   // invalidated, which is too much work for an otherwise inlined setter
<span class="lineNum">     237 </span>            :   // method.)
<span class="lineNum">     238 </span>            :   virtual int GetCachedSize() const = 0;
<span class="lineNum">     239 </span>            : 
<span class="lineNum">     240 </span>            :  private:
<span class="lineNum">     241 </span>            :   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageLite);
<span class="lineNum">     242 </span>            : };
<span class="lineNum">     243 </span>            : 
<span class="lineNum">     244 </span>            : }  // namespace protobuf
<span class="lineNum">     245 </span>            : 
<span class="lineNum">     246 </span>            : }  // namespace google
<span class="lineNum">     247 </span>            : #endif  // GOOGLE_PROTOBUF_MESSAGE_LITE_H__
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
